
function [y1,x1,n1,y2,x2,n2,y3,x3,n3,y4,x4,n4] = gen_data(by,bx)

% entire data set
% y=by;
% x=bx;
% n=size(y,1);
% save data y x n;
% clear y x n;

% neither treated
ind=((bx(:,1)<.50) & (bx(:,2)<.5));
y1=by(ind);
x1=bx(ind,:);
n1=size(y1,1);
%save data_1 y1 x1 n1;

% origin treated
ind=((bx(:,1)>=.50) & (bx(:,2)<.5));
y2=by(ind);
x2=bx(ind,:);
n2=size(y2,1);
%save data_2 y2 x2 n2;

% dest treated
ind=((bx(:,1)<.50) & (bx(:,2)>=.5));
y3=by(ind);
x3=bx(ind,:);
n3=size(y3,1);
%save data_3 y3 x3 n3;

% origin and dest treated
ind=((bx(:,1)>=.50) & (bx(:,2)>=.5));
y4=by(ind);
x4=bx(ind,:);
n4=size(y4,1);
%save data_4 y4 x4 n4;

end















